package core.server;

public class ServerReceive extends Thread {
	private ServerHandler<?> serverHandler;

	public ServerReceive(ServerHandler<?> serverHandler) {
		this.serverHandler = serverHandler;
	}

	@Override
	public void run() {
		while(serverHandler.isReceive()){
			serverHandler.resetStartTime();
			serverHandler.receive();
			Runtime rt = Runtime.getRuntime();
			serverHandler.onRun();
			try {
				sleep(10);
			} catch (InterruptedException e) {
				serverHandler.onError(e, "");
			}
		}
	}
}
